<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>Compact News Reader with jQuery - Ahmed Swailm</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="description" content="Compact News Reader with jQuery" />
        <meta name="keywords" content="jquery, css3, news reader, latest posts, articles, blog, news"/>
        <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon"/> 
        <link rel="stylesheet" href="css/style.css" type="text/css" media="screen"/>
        <script src="js/cufon-yui.js" type="text/javascript"></script>
        <script src="js/Bebas_400.font.js" type="text/javascript"></script>
        <script type="text/javascript">
            Cufon('.cn_wrapper h1,h2', {
                textShadow: '-1px 1px black'
            });
        </script>
        <style type="text/css">
          span.reference a{
            text-shadow:1px 1px 1px #fff;
            color:#999;
            text-transform:uppercase;
            text-decoration:none;
            position:fixed;
            right:10px;
            top:10px;
            font-size:13px;
            font-weight:bold;
          }
          span.reference a:hover{
            color:#555;
          }
          h1.title{
              color:#777;
              font-size:30px;
              margin:10px;
              font-weight:normal;
              text-shadow:1px 1px 1px #fff;
            }
      </style>
    </head>
    
    <body>
        <h1 class="title">EGYJOOMLA - EGYGFX - JQUERYFORU - EGYWP</h1>
        <div class="cn_wrapper">
            <div id="cn_preview" class="cn_preview">
                <div class="cn_content" style="top:5px;">
                    <img src="images/polaroidphotobar.jpg" alt=""/>
                    <h1>Polaroid Photobar Gallery with jQuery</h1>
                    <span class="cn_date">28/09/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>In this tutorial we are going to create an image gallery with a Polaroid look.
                        We will have albums that will expand to sets of slightly rotated thumbnails
                        that pop out on hover.</p>
                    <a href="http://tympanus.net/codrops/2010/09/28/polaroid-photobar-gallery/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/fullpageimagegallery.jpg" alt=""/>
                    <h1>Full Page Image Gallery with jQuery</h1>
                    <span class="cn_date">08/09/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>In this tutorial we are going to create a stunning full page gallery with
                        scrollable thumbnails and a scrollable full screen preview.
                        </p>
                    <a href="http://tympanus.net/codrops/2010/09/08/full-page-image-gallery/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/collapsingsitenavigation.jpg" alt=""/>
                    <h1>Collapsing Site Navigation with jQuery</h1>
                    <span class="cn_date">06/09/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        Today we will create a collapsing menu that contains vertical
                        navigation bars and a slide out content area. When hovering
                        over a menu item, an image slides down from the top and a
                        submenu slides up from the bottom.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/09/06/collapsing-site-navigation/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/thumbnailsnavigation.jpg" alt=""/>
                    <h1>Thumbnails Navigation Gallery with jQuery</h1>
                    <span class="cn_date">29/07/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        In this tutorial we are going to create an extraordinary
                        gallery with scrollable thumbnails that slide out from a
                        navigation. We are going to use jQuery and some CSS3
                        properties for the style.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/29/thumbnails-navigation-gallery/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/musicportfoliotemplate.jpg" alt=""/>
                    <h1>Music Portfolio Template</h1>
                    <span class="cn_date">26/07/2010</span>
                    <span class="cn_category">Development</span>
                    <p>
                        Today we want to share a music portfolio template with you.
                        The idea is to create an artist portfolio with a discography
                        line up and HTML5 audio player jPlayer.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/26/music-portfolio-template/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/relatedpostsslideouts.jpg" alt=""/>
                    <h1>Related Posts Slide Out Boxes</h1>
                    <span class="cn_date">21/07/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        The main idea is to show a fixed list at the right side
                        of the screen with some thumbnails sticking out. When
                        the user hovers over the items, they slide out.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/21/related-posts-slide-out-boxes/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/LatestTweetsTooltip.jpg" alt=""/>
                    <h1>Latest Tweets Tooltip with jQuery</h1>
                    <span class="cn_date">20/07/2010</span>
                    <span class="cn_category">Development</span>
                    <p>
                        If you have a news website, it might be interesting
                        for you to allow your users to see the latests tweets
                        about a topic. Here is a jQuery plugin for showing the
                        latest tweets about a certain word or phrase.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/20/latest-tweets-tooltip/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/slidedownbox.jpg" alt=""/>
                    <h1>Slide Down Box Menu with jQuery and CSS3</h1>
                    <span class="cn_date">16/07/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        In this tutorial we will create a unique sliding box
                        navigation. The idea is to make a box with the menu
                        item slide out, while a thumbnail pops up.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/16/slide-down-box-menu/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/MinimalisticSlideshowGallery.jpg" alt=""/>
                    <h1>Minimalistic Slideshow Gallery with jQuery</h1>
                    <span class="cn_date">05/07/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        In today’s tutorial we will create a simple and
                        beautiful slideshow gallery that can be easily
                        integrated in your web site.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/05/minimalistic-slideshow-gallery/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/imagehighlight.jpg" alt=""/>
                    <h1>Image Highlighting and Preview with jQuery</h1>
                    <span class="cn_date">04/07/2010</span>
                    <span class="cn_category">Tutorials</span>
                    <p>
                        In this tutorial we will show you how to highlight
                        and preview images that are integrated in an
                        article or spread over a page.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/04/image-highlighting-preview/" target="_blank" class="cn_more">Read more</a>
                </div>
                <div class="cn_content">
                    <img src="images/photodesk.jpg" alt=""/>
                    <h1>Interactive Photo Desk</h1>
                    <span class="cn_date">01/07/2010</span>
                    <span class="cn_category">Development</span>
                    <p>
                        In this little experiment we created an interactive photo
                        desk that provides some “realistic” interaction possibilities
                        for the user.
                    </p>
                    <a href="http://tympanus.net/codrops/2010/07/01/interactive-photo-desk/" target="_blank" class="cn_more">Read more</a>
                </div>
            </div>
            <div id="cn_list" class="cn_list">
                <div class="cn_page" style="display:block;">
                    <div class="cn_item selected">
                        <h2>Polaroid Photobar Gallery with jQuery</h2>
                        <p>Tutorial on how to create a gallery in polaroid style</p>
                    </div>
                    <div class="cn_item">
                        <h2>Full Page Image Gallery with jQuery</h2>
                        <p>Another tutorial on how to make a full page image gallery with some jQuery</p>
                    </div>
                    <div class="cn_item">
                        <h2>Collapsing Site Navigation with jQuery</h2>
                        <p>This tutorial shows how to create a stylish sliding site navigation</p>
                    </div>
                    <div class="cn_item">
                        <h2>Thumbnails Navigation Gallery</h2>
                        <p>This gallery will show images in a scrollable menu navigation</p>
                    </div>
                </div>
                <div class="cn_page">
                    <div class="cn_item">
                        <h2>Music Portfolio Template</h2>
                        <p>A template for a music portfolio website with an HTML5 audio player</p>
                    </div>
                    <div class="cn_item">
                        <h2>Related Posts Slide Out Boxes</h2>
                        <p>Show users more of your articles with these slide out boxes</p>
                    </div>
                    <div class="cn_item">
                        <h2>Latest Tweets Tooltip with jQuery</h2>
                        <p>A Plugin for showing the latest tweets with a certain word in your article</p>
                    </div>
                    <div class="cn_item">
                        <h2>Slide Down Box Menu with jQuery and CSS3</h2>
                        <p>A menu with a nice effect</p>
                    </div>
                </div>
                <div class="cn_page">
                    <div class="cn_item">
                        <h2>Minimalistic Slideshow Gallery</h2>
                        <p>A compact image gallery for your website</p>
                    </div>
                    <div class="cn_item">
                        <h2>Image Highlighting and Preview</h2>
                        <p>Highlight and preview images that are integrated in an article</p>
                    </div>
                    <div class="cn_item">
                        <h2>Interactive Photo Desk</h2>
                        <p>Creating a photo desk with some real world interaction</p>
                    </div>
                </div>
                <div class="cn_nav">
                    <a id="cn_prev" class="cn_prev disabled"></a>
                    <a id="cn_next" class="cn_next"></a>
                </div>
            </div>
        </div>
        <!-- The JavaScript -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
        <script type="text/javascript" src="jquery.easing.1.3.js"></script>
        <script type="text/javascript">
            $(function() {
                //caching
                //next and prev buttons
                var $cn_next    = $('#cn_next');
                var $cn_prev    = $('#cn_prev');
                //wrapper of the left items
                var $cn_list     = $('#cn_list');
                var $pages        = $cn_list.find('.cn_page');
                //how many pages
                var cnt_pages    = $pages.length;
                //the default page is the first one
                var page        = 1;
                //list of news (left items)
                var $items         = $cn_list.find('.cn_item');
                //the current item being viewed (right side)
                var $cn_preview = $('#cn_preview');
                //index of the item being viewed. 
                //the default is the first one
                var current        = 1;
                
                /*
                for each item we store its index relative to all the document.
                we bind a click event that slides up or down the current item
                and slides up or down the clicked one. 
                Moving up or down will depend if the clicked item is after or
                before the current one
                */
                $items.each(function(i){
                    var $item = $(this);
                    $item.data('idx',i+1);
                    
                    $item.bind('click',function(){
                        var $this         = $(this);
                        $cn_list.find('.selected').removeClass('selected');
                        $this.addClass('selected');
                        var idx            = $(this).data('idx');
                        var $current     = $cn_preview.find('.cn_content:nth-child('+current+')');
                        var $next        = $cn_preview.find('.cn_content:nth-child('+idx+')');
                        
                        if(idx > current){
                            $current.stop().animate({'top':'-300px'},600,'easeOutBack',function(){
                                $(this).css({'top':'310px'});
                            });
                            $next.css({'top':'310px'}).stop().animate({'top':'5px'},600,'easeOutBack');
                        }
                        else if(idx < current){
                            $current.stop().animate({'top':'310px'},600,'easeOutBack',function(){
                                $(this).css({'top':'310px'});
                            });
                            $next.css({'top':'-300px'}).stop().animate({'top':'5px'},600,'easeOutBack');
                        }
                        current = idx;
                    });
                });
                
                /*
                shows next page if exists:
                the next page fades in
                also checks if the button should get disabled
                */
                $cn_next.bind('click',function(e){
                    var $this = $(this);
                    $cn_prev.removeClass('disabled');
                    ++page;
                    if(page == cnt_pages)
                        $this.addClass('disabled');
                    if(page > cnt_pages){ 
                        page = cnt_pages;
                        return;
                    }    
                    $pages.hide();
                    $cn_list.find('.cn_page:nth-child('+page+')').fadeIn();
                    e.preventDefault();
                });
                /*
                shows previous page if exists:
                the previous page fades in
                also checks if the button should get disabled
                */
                $cn_prev.bind('click',function(e){
                    var $this = $(this);
                    $cn_next.removeClass('disabled');
                    --page;
                    if(page == 1)
                        $this.addClass('disabled');
                    if(page < 1){ 
                        page = 1;
                        return;
                    }
                    $pages.hide();
                    $cn_list.find('.cn_page:nth-child('+page+')').fadeIn();
                    e.preventDefault();
                });
                
            });
        </script>
    </body>
</html>